#!/bin/bash

LIMIT=$1
COUNTER=0
REPEATED=0
DIFFERENT=0

STRING="1cadena a testear"

while [ $COUNTER -lt $LIMIT ]; do
OUTEST1=`java -jar ../../../target/CryptoByn-1.0-SNAPSHOT.jar "$STRING"`
OUTEST2=`echo $OUTEST | grep "$STRING"`
if [ "$OUTEST1" = "$OUTEST2" ]; then
let REPEATED=REPEATED+1
else
let DIFFERENT=DIFFERENT+1
fi
let COUNTER=COUNTER+1
done

echo "FAILED CRYPT: $REPEATED" > perflog
echo "SUCCED CRYPT: $DIFFERENT" >> perflog
